home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume22 / wp2x / part02 < prev    next >
Encoding:
Text File  |  1991-08-23  |  25.2 KB  |  1,020 lines

  1. Newsgroups: comp.sources.misc
  2. From: Raymond Chen <rjc@math.princeton.edu>
  3. Subject:  v22i056:  wp2x - WordPerfect4.2 to Whatever converter, Part02/03
  4. Message-ID: <1991Aug23.184910.9743@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 5129a12ab779c46f97628736316fe07a
  6. Date: Fri, 23 Aug 1991 18:49:10 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Raymond Chen <rjc@math.princeton.edu>
  10. Posting-number: Volume 22, Issue 56
  11. Archive-name: wp2x/part02
  12. Environment: Amiga, MS-DOS, UNIX, ANSI-C
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 2 (of 3)."
  21. # Contents:  tex.cfg wp2x.1l
  22. # Wrapped by rjc@tomato on Wed Aug 21 00:08:05 1991
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'tex.cfg' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'tex.cfg'\"
  26. else
  27. echo shar: Extracting \"'tex.cfg'\" \(6395 characters\)
  28. sed "s/^X//" >'tex.cfg' <<'END_OF_FILE'
  29. X# TeX configuration file for WP2X.
  30. X#
  31. X# Written 5/20/89 by Raymond Chen.
  32. X# Updated 7/05/91 by Raymond Chen.
  33. X#
  34. X# If you change this file, please make a note of it below
  35. X# and in the BEGIN string.  (And probably also in the typeout
  36. X# string.)
  37. X#
  38. X# Version 0.0:  Initial version.
  39. X# Version 0.1:  Add more magic characters.
  40. X# Version 0.2:  Add new tags, reorder existing tags for easier comparison.
  41. X# Version 0.3:  Fix Note#
  42. X# Version 0.4:  Fix some %'s that weren't doubled
  43. X# Version 0.5:  Discuss { } \
  44. X# Version 0.6:  New output scheme.
  45. X
  46. Xtypeout="TeX descriptor file for WP2X by Raymond Chen\n"
  47. X
  48. X# At the beginning of the file, we put some macros which are
  49. X# used by the page numbering routines.
  50. X
  51. XBEGIN="%% This file was created by the WP2X program, using a TeX
  52. X%% descriptor file (Version 0.6) written by Raymond Chen.
  53. X%% Do not expect everything to be converted perfectly.
  54. X%%
  55. X%% Macros for page numbering.
  56. X\\def\\numberleft{\\tenrm\\folio\\hss}
  57. X\\def\\numbercenter{\\hss\\tenrm\\folio\\hss}
  58. X\\def\\numberright{\\tenrm\\folio\\hss}
  59. X\\def\\numberevenodd{\\ifodd\\pageno\\numberright\\else\\numberleft\\fi}
  60. X%% Macros for conditional end of page
  61. X\\def\\CondEOP#1{\\vskip0pt plus#1\\baselineskip\\penalty0
  62. X               \\vskip0pt plus-#1\\baselineskip}
  63. X%%
  64. X
  65. X"
  66. X
  67. XEND="\\vfill\\eject\\end
  68. X%% That's all, folks.
  69. X"
  70. X
  71. X# How to make a one-line comment in TeX.
  72. XComment="%\n%% "
  73. Xcomment="\n"
  74. X
  75. X# Protect magic characters.
  76. X'%'="\\%%"
  77. X'$'="\\$"
  78. X'#'="\\#"
  79. X'&'="\\&"
  80. X'^'="\\^{}"
  81. X'_'="\\_"
  82. X'~'="\\~{}"
  83. X
  84. X# Curly braces and backslashes are intentionally left untranslated.
  85. X# If you want them to be converted, uncomment these three lines.
  86. X#
  87. X#   '{'="$\\{$"
  88. X#   '}'="$\\}$"
  89. X#   '\\'="$\\backslash$"
  90. X#
  91. X# These characters are left untranslated because they do not exist
  92. X# in the TeX font tables.  I.e., they won't be printed in boldface
  93. X# or italic or whatever font you selected; they always come from
  94. X# the math font.
  95. X
  96. X# Now the actual code expansions.
  97. X
  98. XPageNo="\\folio{}"           # insert page number
  99. XRomanPage="\\pageno=-%1 "    # set roman numerals
  100. XArabicPage="\\pageno=%1 "    # set arabic numerals
  101. X
  102. XHSpace="~"                   # Unbreakable space
  103. X
  104. X# If you use tables, you may want to change the definition of Tab below.
  105. XTab="%\n\n\\indent "         # Tabs mean to indent and start a new para.
  106. X
  107. XBeginTabs="%\n%% [Tab settings at "
  108. XSetTab="%1 "
  109. XSetTabCenter="%1(center) "
  110. XSetTabRight="%1(right) "
  111. XSetTabDecimal="%1(decimal) "
  112. XEndTabs="]\n"
  113. X
  114. XHPg="%\n\\vfill\\eject\n"    # Hard page is just a \vfill\eject
  115. XCondEOP="\\CondEOP{%1}"      # Conditional end-of-page
  116. X
  117. XHRt="%\n\n"                  # Hard return becomes a blank line
  118. XSRt="%\n"                    # Soft return is a newline
  119. X
  120. X-="-"                        # Hyphens are hyphens
  121. X--="-%%\n"                   # Hyphen at the end of a line gets a %
  122. X=="{-}"                      # Nonbreaking hyphen
  123. X\-="\\-"                     # Discretionary hyphen
  124. X\--="\\-%%\n"                # Discretionary hyphen at the end of the line
  125. X
  126. X# Margins are left as comments, since TeX margins are rather hairy
  127. X# The only interesting that left/right margins does is end the paragraph.
  128. XMarg="%\n\n%% left margin %1, right margin %2\n"
  129. XTopMarg="%\n%% top margin %1\n"
  130. XPageLength="%\n%% page length %1\n"
  131. X
  132. X# Line spacing changes are treated by storing the proper value into
  133. X# \baselineskip.
  134. X
  135. XSS="\\baselineskip=\\normalbaselineskip\n"
  136. X1.5S="\\baselineskip=1.5\\normalbaselineskip\n"
  137. XDS="\\baselineskip=2\\normalbaselineskip\n"
  138. XTS="\\baselineskip=3\\normalbaselineskip\n"
  139. XLS="\\baselineskip=%1\\normalbaselineskip \\divide\\baselineskip by2\n"
  140. XLPI="%\n%% Change to %1 lines per inch\n"
  141. X
  142. XBold="{\\bf "                # Boldface
  143. Xbold="}"
  144. XUnd="{\\it "                 # Underlining is in italics
  145. Xund="\\/}"                   # with italic correction stuck in always.
  146. XRed="{\\redline "            # Redline
  147. Xred="}"
  148. XStrike="{\\strikeout "       # Strikeout
  149. Xstrike="}"
  150. XRev="{\\reverse "            # Reverse video
  151. Xrev="}"
  152. XOver="\\llap{"               # Overprinting is faked with \llap
  153. Xover="}"
  154. XSup="\\raise.5ex\\hbox{"     # fake superscript
  155. Xsup="}"
  156. XSub="\\lower.5ex\\hbox{"     # fake subscript
  157. Xsub="}"
  158. X
  159. X# UpHalfLine, DownHalfLine, AdvanceToHalf -- undefined
  160. X
  161. XIndent="%\n\n{\\narrower "   # Indented paragraphs use \narrower; this
  162. XDIndent="%\n\n{\\narrower "  # is not a perfect solution, but it's a start.
  163. Xindent="\\par}"
  164. XMarginRelease="\\leavevmode\\kern-%1em "
  165. X
  166. XCenter="%\n\n\\centerline{"
  167. Xcenter="}"
  168. XCenterHere="\\centerhere{"   # Not supported
  169. Xcenterhere="}"
  170. X
  171. XAlign="\\align{"             # Not supported
  172. Xalign="}"
  173. XFlushRight="\\rightline{"
  174. Xflushright="}"
  175. X
  176. X# Math, math, MathCalc, MathCalcColumn, SubTtl, IsSubTtl, Ttl, IsTtl, GrandTtl
  177. X# Col, col -- undefined
  178. X
  179. XFn="\\note{"                 # This uses the \note macros in the TeXbook
  180. Xfn="}"
  181. XSetFn#="\\notenumber=%1 "
  182. XEn="\\endnote{"              # You'll have to write your own \endnote macro
  183. Xen="}"
  184. XFNote#=""                    # Note numbers are automatically generated.
  185. XENote#=""                    # Note numbers should be automatically generated.
  186. X
  187. X# TableMarker -- undefined
  188. X
  189. XHyph="\\hyphenpenalty=50\n"        # Allow hyphenation
  190. Xhyph="\\hyphenpenalty=10000\n"     # Disable hyphenation
  191. XNoHyphWord="\\hbox{}"              # Suppress hyphenation of next word
  192. XJust="\\rightskip=0pt\n"           # Right justify
  193. Xjust="\\raggedright\n"             # Ragged right
  194. XWid="\\clubpenalty=150 \\widowpenalty=150\n" # Widow protection
  195. Xwid="\\clubpenalty=0 \\widowpenalty=0\n" # Allow widows
  196. X
  197. X# HZone, DAlign -- undefined
  198. X
  199. X# Headers and footers
  200. XHeader="\\headline={"
  201. Xheader="}"
  202. XFooter="\\footline={"
  203. Xfooter="}"
  204. X
  205. X# These guys are left as comments, since actually doing them right
  206. X# requires all sorts of icky things I'd rather not think about.
  207. XSupp="%\n%% Suppress headers and footers on this page\n"
  208. XCtrPg="%\n%% Center this page vertically\n"
  209. XSetFont="%\n%% Change to %1 pitch, font %2\n"
  210. XSetBin="%\n%% Change to paper bin %1\n"
  211. X
  212. X# Page numbering
  213. XPN0="\\headline={\\hss}\\footline={\\hss}%%\n"
  214. XPN1="\\headline={\\numberleft}\\footline={\\hss}%%\n"
  215. XPN2="\\headline={\\numbercenter}\\footline={\\hss}%%\n"
  216. XPN3="\\headline={\\numberright}\\footline={\\hss}%%\n"
  217. XPN4="\\headline={\\numberevenodd}\\footline={\\hss}%%\n"
  218. XPN5="\\headline={\\hss}\\footline={\\numberleft}%%\n"
  219. XPN6="\\headline={\\hss}\\footline={\\numbercenter}%%\n"
  220. XPN7="\\headline={\\hss}\\footline={\\numberright}%%\n"
  221. XPN8="\\headline={\\hss}\\footline={\\numberevenodd}%%\n"
  222. END_OF_FILE
  223. if test 6395 -ne `wc -c <'tex.cfg'`; then
  224.     echo shar: \"'tex.cfg'\" unpacked with wrong size!
  225. fi
  226. # end of 'tex.cfg'
  227. fi
  228. if test -f 'wp2x.1l' -a "${1}" != "-c" ; then 
  229.   echo shar: Will not clobber existing file \"'wp2x.1l'\"
  230. else
  231. echo shar: Extracting \"'wp2x.1l'\" \(16361 characters\)
  232. sed "s/^X//" >'wp2x.1l' <<'END_OF_FILE'
  233. X.TH WP2X 1
  234. X.SH NAME
  235. X wp2x \- A WordPerfect 4.2 to whatever converter
  236. X.SH SYNOPSIS
  237. X.B wp2x
  238. X[
  239. X.B \-s
  240. X] [
  241. X.BI \-n blip
  242. X] configfile wpfile
  243. X.SH DESCRIPTION
  244. X.de Tx
  245. X.if n TeX\\$1
  246. X.if t T\v'12u'E\v'-12u'X\\$1
  247. X..
  248. X.de Lt
  249. X.if n LaTeX\\$1
  250. X.if t L\v'-12u'A\v'12u'T\v'12u'E\v'-12u'X\\$1
  251. X..
  252. X.I Wp2x
  253. Xis intended to convert
  254. X.I simple
  255. Xfiles stored in WordPerfect 4.2 format into any other document processing
  256. Xlanguage that uses plain text files.  Examples include
  257. X.Tx ,
  258. X.Lt ,
  259. Xtroff, GML, and SCRIPT.
  260. X.PP
  261. X.I Wp2x
  262. Xreads a configuration file and a WordPerfect 4.2 input file, and
  263. Xuses the information in them to produce an output file, which
  264. Xis sent to stdout.
  265. XIf the configuration file cannot be found, a suffix of
  266. X.I .cfg
  267. Xis appended.
  268. Xthe current directory is searched, as well as the directory
  269. X.I /usr/local/lib/wp2x ,
  270. Xand the directories specified by the environment variables
  271. X.I PATH ,
  272. X.I DPATH ,
  273. Xand
  274. X.I WP2XLIB .
  275. X.PP
  276. XThe following codes are processed by
  277. X.IR wp2x :
  278. X.nf
  279. X
  280. X    Hard returns.
  281. X    Sort returns.
  282. X    Hyphens of all ages.
  283. X    Hard page breaks.
  284. X    Margin settings.
  285. X    Line spacing.
  286. X    Tab characters.
  287. X    Boldface, underline, redline.
  288. X    Indented paragraphs.  (The "Indent" code.)
  289. X    Footnotes and endnotes.
  290. X    Footnote numbers inside footnotes.
  291. X    Extended IBM codes.
  292. X    Superscript, subscript, overstrike.
  293. X    Hyphenation on/off.
  294. X    Justification on/off.
  295. X    Widow/Orphan control.
  296. X    Hyphenation zone.
  297. X    Decimal alignment character.
  298. X    Page centering.
  299. X    Page number position.
  300. X    Headers and footers.
  301. X    Single-page suppression of header/footer information.
  302. X    Lots of other stuff.
  303. X
  304. XThe following codes are recognized, but not translated.
  305. X
  306. X    Page number column
  307. X    Underline mode
  308. X    Column definitions
  309. X    Footnote attributes
  310. X    Automatic paragraph numbering
  311. X    Marked text
  312. X    Invisible text
  313. X
  314. X.fi
  315. XThese codes are not translated because documents that require these
  316. Xcodes typically would require significant hand-editing.
  317. XHence, there's no point in trying to emulate something you're going
  318. Xto delete anyway.
  319. X(Remember,
  320. X.I wp2x
  321. Xis not intended to be used as an automated conversion program.
  322. XRather, it is intended to be used as a single step in the document
  323. Xconversion process, which gets most of the the grunt work of conversion
  324. Xdone and out of the way, so that you can concentrate your efforts on
  325. Xconverting the trickier parts of the document.  The object of the
  326. Xgame is to produce a readable conversion, rather than a perfect conversion.)
  327. X.PP
  328. XAs the program runs, a dot is printed to
  329. X.I stderr
  330. Xfor every 1024 characters converted.  This can be suppressed with the
  331. X.B \-s
  332. Xswitch, and the interval between dots can be changed with the
  333. X.B -n
  334. Xswitch.
  335. X.SH OPTIONS
  336. X.TP
  337. X.B \-s
  338. XSuppresses all non-error output to
  339. X.IR stderr ,
  340. Xincluding the
  341. X.I typeout
  342. Xbanner, the progress dots, and warnings about undefined expansions.
  343. X.TP
  344. X.BI \-n blip
  345. XEvery
  346. X.I blip
  347. Xtokens, a dot is emitted to
  348. X.IR stderr ,
  349. Xunless the
  350. X.B \-s
  351. Xswitch is given.
  352. XThe value
  353. X.I blip
  354. Xmust appear imediately following the
  355. X.B \-n
  356. Xwithout an intervening space.
  357. XIf no
  358. X.B \-n
  359. Xswitch is supplied, then a value of 1024 is assumed.
  360. X.SH USAGE
  361. XThe configuration file controls how the file is converted from WordPerfect 4.2
  362. Xformat.  Each line of the configuration file is of the form
  363. X.sp 1
  364. X.ce 1
  365. Xidentifier="list of codes"
  366. X.sp 1
  367. Xwhere the list of codes is a string which will be placed in the
  368. Xoutput stream whenever the corresponding WordPerfect code is
  369. Xencountered.
  370. XStandard C-style backslash-escape sequences are recognized, as well
  371. Xas \exFF for hex values.
  372. XYou do not have to backslash-protect a newline.  Some identifiers
  373. Xsupply replacable parameters, which can be interpolated as follows:
  374. X.TP
  375. X%1
  376. Xinterpolate first parameter as a decimal integer.
  377. X.TP
  378. X%2
  379. Xinterpolate second parameter as a decimal integer.
  380. X.TP
  381. X%c
  382. Xinterpolate first parameter as an ASCII character.
  383. X.TP
  384. X%\en
  385. Xinterpolate a newline if the most-recently-output character was not
  386. Xalready a newline.
  387. X(The
  388. X.I \en
  389. Xcan be either the C-style escape sequence, or an actual newline character.)
  390. XUse this if the expansion must take place at the beginning of a line.
  391. X(For example,
  392. X.I troff
  393. Xcontrol characters must appear as the first character in the line in
  394. Xorder to take effect.)
  395. XThis sequence is meaningful only at the beginning of the string;
  396. Xif it appears elsewhere, it is flagged as erroneous.
  397. X.TP
  398. X%%
  399. Xinterpolate a percent-sign.
  400. X.PP
  401. XA percent sign followed by any other character is considered an error.
  402. XIt is also an error to interpolate a parameter that is not applicable
  403. Xto the identifier being defined.  You may interpolate the parameters
  404. Xas many times as, and in whatever order, you wish.  (With the
  405. Xexception of the
  406. X.I %\en
  407. Xcode.)
  408. X.PP
  409. XHere follows a list of the accepted identifiers.
  410. XIn the discussion, `%1' represents the first parameter, and `%2'
  411. Xthe second.  Remember that the character version of %1 is available
  412. Xas `%c'.
  413. X.sp 1
  414. X.PD 0
  415. X.TP 15
  416. XBEGIN
  417. XExpanded at the beginning of the file.
  418. X.TP
  419. XEND
  420. XExpanded at the end of the file.
  421. X.TP
  422. XCOMMENT
  423. XExpanded when wp2x needs to insert a comment into the output.
  424. XThe comment is passed as %s.
  425. X.sp 1
  426. X.TP
  427. XPageNo
  428. XInsert current page number
  429. X.TP
  430. XRomanPage
  431. XSet page number to %1, and set roman-numeral mode
  432. X.TP
  433. XArabicPage
  434. XSet page number to %1, and set arabic-numeral mode
  435. X.sp 1
  436. X.TP
  437. XTab
  438. XWhat to do when you see a tab character.
  439. X.TP
  440. XBeginTabs
  441. XEmitted when tab settings are about to change.
  442. XThe
  443. X.B BeginTabs
  444. Xcode should delete all existing tabs
  445. Xand prepare for new tab settings to start.
  446. XAll tab values are given in columns measured
  447. Xfrom the physical left edge of the paper.
  448. X(Not from the left margin.)
  449. X.TP
  450. XSetTab
  451. XSet a normal (left-justified) tabstop at column %1.
  452. X.TP
  453. XSetTabCenter
  454. XSet a centered tabstop at column %1.
  455. X.TP
  456. XSetTabRight
  457. XSet a right-justified tabstop at column %1.
  458. X.TP
  459. XSetTabDecimal
  460. XSet a decimal tab at column %1.
  461. X.TP
  462. XEndTabs
  463. XFinish the setting of tabstops.
  464. X.sp 1
  465. X.PP
  466. XFor example, if the WordPerfect file contains a code that says
  467. X`Set new tabstops as follows:  Regular tab at column 15,
  468. Xa centered tab at column 40, a right-justified tab at column 59,
  469. Xand a regular tab at column 60', then the following expansions are
  470. Xmade in succession:
  471. X.nf
  472. X
  473. X    BeginTabs
  474. X    SetTab(15)
  475. X    SetTabCenter(40)
  476. X    SetTabright(59)
  477. X    SetTab(60)
  478. X    EndTabs
  479. X
  480. X.fi
  481. X.TP
  482. XHSpace
  483. XHard (nonbreakable) space.
  484. X.TP
  485. XHPg
  486. XHard page break.
  487. X.TP
  488. XCondEOP
  489. XForce a new page if fewer than %1 half-lines remain on current page.
  490. X.sp 1
  491. X.TP
  492. XHRt
  493. XHard return.
  494. X.TP
  495. XSRt
  496. XSoft return.
  497. X.sp 1
  498. X.TP
  499. X\-
  500. XBreakable hyphen.
  501. X.TP
  502. X\-\-
  503. XBreakable hyphen, appearing at the end of a line.
  504. X.TP
  505. X=
  506. XNon-breakable hyphen.
  507. X.TP
  508. X\e\-
  509. XDiscretionary hyphen.
  510. X.TP
  511. X\e\-\-
  512. XDiscretionary hyphen, appearing at the end of a line.
  513. X.sp 1
  514. X.TP
  515. XMarg
  516. XSet left margin at %1 characters and right margin at %2 characters.
  517. X.TP
  518. XTopMargin
  519. XSet top margin to %1 lines.
  520. X.TP
  521. XPageLength
  522. XSet page length to %1 lines.
  523. X.sp 1
  524. X.TP
  525. XSS
  526. XSingle spacing.
  527. X.TP
  528. XDS
  529. XDouble spacing.
  530. X.TP
  531. X1.5S
  532. XOne-and-a-half spacing.
  533. X.TP
  534. XTS
  535. XTriple spacing.
  536. X.TP
  537. XLS
  538. XOther line spacing.  %1 is twice the desired spacing.
  539. X(For example, a request for 2.5-spacing sets %1=5.)
  540. X.TP
  541. XLPI
  542. XSet %1 lines per inch (%1 is either 6 or 8)
  543. X.sp 1
  544. X.TP
  545. XBold
  546. XBegin boldface
  547. X.TP
  548. Xbold
  549. XEnd boldface
  550. X.TP
  551. XUnd
  552. XBegin underline
  553. X.TP
  554. Xund
  555. XEnd underline
  556. X.TP
  557. XRed
  558. XBegin redline
  559. X.TP
  560. Xred
  561. XEnd redline
  562. X.TP
  563. XStrike
  564. XBegin strikeout
  565. X.TP
  566. Xstrike
  567. XEnd strikeout
  568. X.TP
  569. XRev
  570. XBegin reverse video
  571. X.TP
  572. Xrev
  573. XEnd reverse video
  574. X.sp 1
  575. X.TP
  576. XOver
  577. XBegin overstrike
  578. X.TP
  579. Xover
  580. XEnd overstrike
  581. X.TP
  582. XSup
  583. XBegin superscript
  584. X.TP
  585. Xsup
  586. XEnd superscript
  587. X.TP
  588. XSub
  589. XBegin subscript
  590. X.TP
  591. Xsub
  592. XEnd subscript
  593. X.sp 1
  594. X.TP
  595. XUpHalfLine
  596. XAdvance printer up 1/2 line
  597. X.TP
  598. XDownHalfLine
  599. XAdvance printer down 1/2 line
  600. X.TP
  601. XAdvanceToHalfLine
  602. XAdvance to absolute vertical position.
  603. X%1 is what WordPerfect thinks the current vertical page position is,
  604. Xin half-lines.  %2 is the desired position, also in half-lines.
  605. X.sp 1
  606. X.TP
  607. XIndent
  608. XExpanded when an "Indent" code appears.
  609. X.TP
  610. XDIndent
  611. XExpanded when a "left-and-right-indent" code appears.
  612. X.TP
  613. Xindent
  614. XExpanded at the end of an indented paragraph.
  615. X.TP
  616. XMarginRelease
  617. XMargin release.  %1 is the number of characters to move left.
  618. X.sp 1
  619. X.TP
  620. XCenter
  621. XCenter current line
  622. X.TP
  623. Xcenter
  624. XEnd centering
  625. X.TP
  626. XCenterHere
  627. XCenter line around current column
  628. X.TP
  629. Xcenterhere
  630. XEnd centering
  631. X.sp 1
  632. X.TP
  633. XAlign
  634. XBegin alignment
  635. X.TP
  636. Xalign
  637. XEnd alignment
  638. X.TP
  639. XAlignChar
  640. XSet alignment character
  641. X.TP
  642. XFlushRight
  643. XBegin flush right
  644. X.TP
  645. Xflushright
  646. XEnd flush right
  647. X.sp 1
  648. X.TP
  649. XMath
  650. XBegin math mode
  651. X.TP
  652. Xmath
  653. XEnd math mode
  654. X.TP
  655. XMathCalc
  656. XBegin math calc mode
  657. X.TP
  658. XMathCalcColumn
  659. XMath calc column
  660. X.sp 1
  661. X.TP
  662. XSubTtl
  663. XDo subtotal
  664. X.TP
  665. XIsSubTtl
  666. XSubtotal entry
  667. X.TP
  668. XTtl
  669. XDo total
  670. X.TP
  671. XIsTtl
  672. XTotal entry
  673. X.TP
  674. XGrandTtl
  675. XDo grand total
  676. X.sp 1
  677. X.TP
  678. XCol
  679. XBegin column mode
  680. X.TP
  681. Xcol
  682. XEnd column mode
  683. X.sp 1
  684. X.TP
  685. XFn
  686. XExpanded at the beginning of a footnote.
  687. X.TP
  688. Xfn
  689. XExpanded at the end of a footnote.
  690. X.TP
  691. XEn
  692. XExpanded at the beginning of an endnote.
  693. X.TP
  694. Xen
  695. XExpanded at the end of an endnote.
  696. X.TP
  697. XSetFn#
  698. XSet the number for the next footnote to %1.
  699. X.TP
  700. XFNote#
  701. XFootnote number.
  702. X.TP
  703. XENote#
  704. XEndnote number.
  705. X.TP
  706. XTableMarker
  707. XInsert table of contents here
  708. X.sp 1
  709. X.TP
  710. XHyph
  711. XEnable hyphenation.
  712. X.TP
  713. Xhyph
  714. XDisable hyphenation.
  715. X.TP
  716. XJust
  717. XEnable justification.
  718. X.TP
  719. Xjust
  720. XDisable justification.
  721. X.TP
  722. XWid
  723. XEnable widow/orphan protection.
  724. X.TP
  725. Xwid
  726. XDisable widow/orphan protection.
  727. X.TP
  728. XHZone
  729. XThe hyphenation zone.  %1 and %2 are the two magical values
  730. Xthat WordPerfect uses to control hyphenation.
  731. X.TP
  732. XDAlign
  733. XSet the decimal alignment character to that whose ASCII value is %1.
  734. X(`%c' is useful here.)
  735. X.sp 1
  736. X.TP
  737. XHeader
  738. XBegin header text
  739. X.TP
  740. Xheader
  741. XEnd header text
  742. X.TP
  743. XFooter
  744. XBegin footer text
  745. X.TP
  746. Xfooter
  747. XEnd footer text
  748. X.sp 1
  749. X.TP
  750. XSupp
  751. XSuppress page number/header/footer information for one page.
  752. X%1 argument is a bit field which describes what sort of
  753. Xsuppression is desired.  Here's what the bits mean:
  754. X.nf
  755. X          1 = all
  756. X          2 = page number
  757. X          4 = page numbers moved to bottom
  758. X          8 = all headers
  759. X         16 = header a
  760. X         32 = header b
  761. X         64 = footer a
  762. X        128 = footer b
  763. X.fi
  764. X.TP
  765. XCtrPg
  766. XCenter page vertically
  767. X.sp 1
  768. X.TP
  769. XSetFont
  770. XChange pitch or font.  %1 is the desired pitch.  (Negative
  771. Xmeans proportionally-spaced.)  %2 is the font number.
  772. X.TP
  773. XSetBin
  774. XSelect paper bin to %1 = 0, 1, ...
  775. X.sp 1
  776. X.TP
  777. XPN0
  778. XNo page numbering.
  779. X.TP
  780. XPN1
  781. XPage number in top left.
  782. X.TP
  783. XPN2
  784. XPage number in top center.
  785. X.TP
  786. XPN3
  787. XPage number in top right.
  788. X.TP
  789. XPN4
  790. XPage number on top outside corners (even/odd).
  791. X.TP
  792. XPN5
  793. XPage number in lower left.
  794. X.TP
  795. XPN6
  796. XPage number in bottom center.
  797. X.TP
  798. XPN7
  799. XPage number in lower right.
  800. X.TP
  801. XPN8
  802. XPage number on bottom outside corners (even/odd).
  803. X.PD
  804. X.PP
  805. XIf no expansion is supplied for an identifier, then nothing is emitted to
  806. X.IR stdout ,
  807. Xbut a warning message is sent to
  808. X.IR stderr .
  809. XThis warning message will appear at most once per identifier, and it
  810. Xcan be suppressed completely by the
  811. X.B \-s
  812. Xoption.
  813. X.PP
  814. XThe special identifier
  815. X.I typeout
  816. Xcauses its replacement text to be
  817. Xdisplayed on the screen every time the configuration file is read.
  818. XThis is useful for identification messages, or reminders to the user.
  819. X.PP
  820. XA special identifier is any character enclosed in single quotation
  821. Xmarks, which represent themselves.  For example,
  822. X.nf
  823. X
  824. X   '\(*a'="{\e\ealpha}"
  825. X
  826. X.fi
  827. Xcauses the string "{\ealpha}" to be emitted when an \(*a is encountered.
  828. XThis could also have been written as
  829. X.nf
  830. X
  831. X   '\exE0'="{\e\ealpha}"
  832. X
  833. X.fi
  834. Xif the character \(*a has ASCII value 0xE0.
  835. X(Which is true for the IBM PC encoding.)
  836. X.PP
  837. XIf no definition exists for a particular special character,
  838. Xit is transmitted undisturbed.  If a special character is encountered
  839. Xfrom the upper half of the ASCII character set, and if it has no
  840. Xdefinition, then a warning message is also emitted.
  841. X(Which can be suppressed with the
  842. X.B \-s
  843. Xoption.)
  844. X.PP
  845. XLines beginning with the # character are comments.
  846. X.SH FILES
  847. XThe sample configuration files in
  848. X.I /usr/local/lib/wp2x
  849. Xgive you some sort of idea what a `production quality'
  850. Xconfiguration file might look like.
  851. XThey are not intended to be used as-is, but rather are meant to be
  852. Xmodified to suit your particular needs.
  853. X.SH "SEE ALSO"
  854. X.IR tex (1),
  855. X.IR latex (1),
  856. X.IR nroff (1),
  857. X.IR troff (1).
  858. X.SH DIAGNOSTICS
  859. X.TP
  860. XError: Cannot open X (reason)
  861. XThe file X could not be opened, for the indicated reason.
  862. X.TP
  863. XError: Expecting a hex digit
  864. XInside a string, you typed the characters `\ex', but the next character
  865. Xwas not a valid hex digit.
  866. X.TP
  867. XError: string pool overflow
  868. XThe configuration file contained too many strings.  Increase the value
  869. Xof POOL_SIZE and recompile.
  870. X.TP
  871. XError: Unknown identifier X
  872. XThe word X was encountered in the configuration file when
  873. X.I wp2x
  874. Xexpected a token identifier like `HRt'.
  875. XMost likely, you either misspelled it, or you got your quotation marks
  876. Xout of sync.
  877. X.TP
  878. XError: Identifier not followed by = sign
  879. XAfter an identifier must come an equals-sign.
  880. X.TP
  881. XError: Quotation mark expected
  882. XAfter the equals-sign must come a quotation mark.
  883. X.TP
  884. XError: X: `%\en' not at start of expansion
  885. XThe expansion for the identifier X contained the indicated sequence
  886. Xof characters somewhere other than the beginning of the string.
  887. XThe `%\en' interpolation code is meaningful only at the beginning
  888. Xof a string.
  889. X.TP
  890. XError: X: invalid escape `%x'
  891. XThe expansion for the identifier X contained an invalid escape.
  892. XEither you used `%1', `%2' or `%c' when the identifier X does not
  893. Xsupply that parameter, or you meant for a genuine percent sign
  894. Xto be output, in which case you should put `%%' in the expansion.
  895. X.TP
  896. XError: Invalid character identifier
  897. XCharacter identifiers can only be one character long (after backslash
  898. Xinterpretation).
  899. X.TP
  900. XWarning: Expected XX but received YY.
  901. XThe program expected the next byte from the WP file to be XX, but
  902. Xthe byte YY was encountered instead.  This means either that your WP
  903. Xfile is damaged, or that the program is seriously confused.  (Or both.)
  904. XThe program
  905. Xwill pretend that the byte in the file was indeed XX, which may
  906. Xlead to synchronization errors later on.
  907. X.TP
  908. XWarning: No expansion for X
  909. XThe WP file contained the token X, but the configuration file did not
  910. Xcontain any expansion text for it.  A null expansion was assumed.
  911. X.TP
  912. XWarning: No expansion for XX (c)
  913. XThe WP file contained the character c (hex code XX),
  914. Xbut the configuration file
  915. Xdid not contain any expansion text for it.
  916. XThe character was emitted unaltered.
  917. XBeware that this may give your text formatter indigestion if it does
  918. Xnot handle eight-bit characters.
  919. X.TP
  920. XWarning: X code not supported
  921. XThe file being converted uses a code which
  922. X.I wp2x
  923. Xdoes not know how to convert.
  924. XA comment is placed in the output file in its place.
  925. XIf you ever encounter a `WPCorp reserved' or a `WPCorp undefined' code,
  926. Xthe author would appreciate hearing from you.
  927. X.TP
  928. XInternal error:  Invalid escape, %x
  929. XWhile processing text,
  930. X.I wp2x
  931. Xnoticed that you used an invalid escape.
  932. XNothing is emitted as the escape text.
  933. X(The internal-ness is that this error is supposed to be caught at
  934. Xthe time the configuration file is read.)
  935. X.SH BUGS
  936. XNaive configuration files will fail if your WP file
  937. Xdoesn't nest its tags properly.  A typical case is
  938. X.nf
  939. X
  940. X     [Center][B]Hello[center]
  941. X     [Center]There[b][center]
  942. X.fi
  943. Xto produce a centered boldface `Hello'.  If you use the naive encoding
  944. Xof
  945. X.nf
  946. X
  947. X     Center="\e\ecenterline{"
  948. X     center="}\en"
  949. X     Bold="{\e\ebf "
  950. X     bold="}"
  951. X
  952. X.fi
  953. Xthen this will expand to
  954. X.nf
  955. X
  956. X     \ecenterline{{\ebf Hello}
  957. X     \ecenterline{There}}
  958. X
  959. X.fi
  960. XWordPerfect has no clean concept of grouping; it lets you change fonts
  961. Xat any time and let those changes propagate outside the current
  962. Xenvironment.
  963. X(With the exception of headers, footers, footnotes, and endnotes.)
  964. X.PP
  965. XNow sure, you could write complicated configuration strings to try
  966. Xto handle this `properly', but it'd probably not be worth the trouble.
  967. XAfter all, the purpose is not to perform a perfect conversion, but
  968. Xrather to produce a
  969. X.I readable
  970. Xconversion, which can then be massaged by hand to produce a perfect
  971. Xmanuscript.
  972. X.PP
  973. XAnother potential problem is combined attributes, like boldface underline.
  974. XUnder a naive configuration,
  975. X.nf
  976. X
  977. X     [B]Boldface [U]Underlined boldface[b] Underlined[u] normal.
  978. X
  979. X.fi
  980. Xcomes out as
  981. X.nf
  982. X
  983. X {\ebf Boldface {\eit Underlined boldface} Underlined\e/} normal.
  984. X
  985. X.fi
  986. Xwhich is wrong for two reasons.  One is the nesting problem discussed
  987. Xabove.  The other is that
  988. X.Tx
  989. Xfont attributes do not combine.
  990. X.PP
  991. XSimilar problems exist for other document preparation systems.
  992. XSo be careful.
  993. X.SH AUTHOR
  994. XRaymond Chen (raymond@math.berkeley.edu)
  995. END_OF_FILE
  996. if test 16361 -ne `wc -c <'wp2x.1l'`; then
  997.     echo shar: \"'wp2x.1l'\" unpacked with wrong size!
  998. fi
  999. # end of 'wp2x.1l'
  1000. fi
  1001. echo shar: End of archive 2 \(of 3\).
  1002. cp /dev/null ark2isdone
  1003. MISSING=""
  1004. for I in 1 2 3 ; do
  1005.     if test ! -f ark${I}isdone ; then
  1006.     MISSING="${MISSING} ${I}"
  1007.     fi
  1008. done
  1009. if test "${MISSING}" = "" ; then
  1010.     echo You have unpacked all 3 archives.
  1011.     rm -f ark[1-9]isdone
  1012. else
  1013.     echo You still need to unpack the following archives:
  1014.     echo "        " ${MISSING}
  1015. fi
  1016. ##  End of shell archive.
  1017. exit 0
  1018.  
  1019. exit 0 # Just in case...
  1020.